
// 屏幕大小
export const _screen = (width, height) => {
    // let width = window.innerWidth, height = window.innerHeight
    // let width = 800, height = 600
    if (width == null || height == null || width === '100%' || height === '100%') {
        let viewer = document.querySelector(".main .screen-viewer")
        if (viewer) {
            let rect = viewer.getBoundingClientRect()
            height = width = Math.min(rect.height, rect.width)
            // height = rect.height
            // width = rect.width
        } else {
            width = 800
            height = 600
        }
    }



    return {
        width,
        height,
        o: [width / 2, height / 2]
    }
}

export const store = {
    currentPage: '',
    screenViewer: '',
    root: '',
    screenWidth: window.innerWidth,
    isH5: window.innerWidth <= 767,
    screen: _screen()
}
